-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
history: fix empty Exporters attribute #5017
Conversation
Ahhh nice catch! Looks like I got the results correctly added to the history record, but for some reason didn't think to get the right exporters attr. Thanks! 🙏 🎉 |
f1b94e4
to
fa2a8b9
Compare
fa2a8b9
to
f11d945
Compare
exporter/containerimage/export.go
Outdated
@@ -187,6 +190,14 @@ func (e *imageExporterInstance) ID() int { | |||
} | |||
|
|||
func (e *imageExporterInstance) Name() string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe Type()
would be better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potentially - note this also mirrors the structures of the cache exporter here.
Type
and Name
SGTM - then we keep the old field.
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
f11d945
to
6b6fa9d
Compare
@@ -22,6 +22,8 @@ type ExporterInstance interface { | |||
ID() int | |||
Name() string | |||
Config() *Config | |||
Type() string | |||
Attrs() map[string]string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(possible follow-up) Maybe the Attrs
and Config()
can be combined somehow in the future. Atm not obvious why there are two similar sounding things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think maybe a better approach is to change the solver.ExporterRequest
to keep array of objects that keep type/attrs instead of raw ExporterInstance
. Like it was previously with the keys that are now removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's get this in as seems functionally correct. #5017 (comment) to be addressed in follow-up
Since multiple exporters support #4134 in BuildKit 0.13,
Record.Exporters
is not set anymore.This is related to the
Type
andAttrs
fields not being set in thellbsolver.ExporterRequest
: https://github.com/moby/buildkit/pull/4134/files#diff-0397d42d692ad676389ccf4b5a1126a3976ef69d4342b8423a6bbb51d21a9181L458-L459But this is used when we want to set the
Exporters
for the build history:buildkit/solver/llbsolver/solver.go
Line 176 in eed17a4
To fix this, I have updated the
exporter.ExporterInstance
interface to expose attributes and name of the exporter. Also removesType
andAttrs
fieldsExporterRequest
that don't seem used anymore.